<script setup lang='ts'>
import { reactive, ref } from 'vue';
import { useRouter } from 'vue-router'
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
const base = import.meta.env.BASE_URL
const router = useRouter()
const orgList = reactive([
  {
    logo: base + "44761321.jpg",
    company: '康普尼',
    createAt: '2022-12-31',
    call: '13333333333',
    anchorSize: '200-500'
  },
  {
    logo: base + "52823142.jpg",
    company: '康普',
    createAt: '2022-12-31',
    call: '13333333333',
    anchorSize: '200-500'
  }
])
type CheckMode = 'review' | 'check'
const showCheck = ref(false), checkMode = ref<CheckMode>('review')
function check(row: any, mode: CheckMode = 'check') {
  showCheck.value = true
  checkMode.value = mode
}
function review(row: any, mode: CheckMode = 'review') {
  showCheck.value = true
  checkMode.value = mode
}
</script>

<template>

  <ElCard>
    <ElDialog v-model="showCheck">
      <template #title>
        经纪人{{ checkMode === 'review' ? '申请' : "" }}信息
      </template>

      <template #footer v-if="checkMode === 'review'">
        <ElButton plain type="primary">拒绝</ElButton>
        <ElButton plain type="warning">同意申请</ElButton>
      </template>
    </ElDialog>
    <div class="flex items-center justify-between  px-8 ">
      <div>
        <!-- <h3>加入机构</h3> -->
      </div>
      <div>
        <ElInput placeholder="输入机构名称">
          <template #append>
            <ElButton :icon="useRenderIcon('ep:search')"></ElButton>
          </template>
        </ElInput>
      </div>
    </div>
    <ElTable class="mt-4" :data="orgList">
      <ElTableColumn label="经纪人"></ElTableColumn>
      <ElTableColumn label="手机号"></ElTableColumn>
      <ElTableColumn label="管理主播"></ElTableColumn>
      <ElTableColumn label="7日活跃主播"></ElTableColumn>
      <ElTableColumn label="今日开战主播"></ElTableColumn>
      <ElTableColumn align="center" label="操作">
        <template #="{ row }">
          <ElButton text type="warning" @click="review(row)">审核</ElButton>
          <ElButton text type="primary" @click="check(row)">查看</ElButton>
        </template>
      </ElTableColumn>
    </ElTable>

  </ElCard>
</template>

<style lang='scss' scoped></style>
